package com.UnionPayCenter.mapper;

import com.UnionPayCenter.distribution.entity.UserDistributionRefDO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserDistributionRefDOMapper {
    int deleteByPrimaryKey(Integer idgen);

    int insert(UserDistributionRefDO record);

    int insertSelective(UserDistributionRefDO record);

    UserDistributionRefDO selectByPrimaryKey(Integer idgen);

    int updateByPrimaryKeySelective(UserDistributionRefDO record);

    int updateByPrimaryKey(UserDistributionRefDO record);

    UserDistributionRefDO selectByCounterpartyUserId(@Param("bId") Long bId, @Param("shopId") Long shopId,
                                                     @Param("userId") Long userId, @Param("counterpartyUserId") Long counterpartyUserId);

    int countRecordByUserId(@Param("bId") Long bId, @Param("shopId") Long shopId,
                            @Param("userId") Long userId);

    int countSecondRecordByUserId(@Param("bId") Long bId, @Param("shopId") Long shopId,
                            @Param("userId") Long userId);

    List<UserDistributionRefDO> listRecordByUserId(@Param("bId") Long bId, @Param("shopId") Long shopId,
                                                   @Param("userId") Long userId);

    List<UserDistributionRefDO> listFirstRecordFilterBlankMobileByUserId(@Param("bId") Long bId, @Param("shopId") Long shopId,
                                                                         @Param("userId") Long userId);

    List<UserDistributionRefDO> listAllRecordFilterBlankMobileByUserId(@Param("bId") Long bId, @Param("shopId") Long shopId,
                                                   @Param("userId") Long userId);

    List<UserDistributionRefDO> listSecondRecordFilterBlankMobileByUserId(@Param("bId") Long bId, @Param("shopId") Long shopId,
                                                                          @Param("userId") Long userId);


    List<UserDistributionRefDO> listUserDistributionRefDOWithSuper(UserDistributionRefDO refDO);
}